package com.york.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;

import java.io.Serializable;
import java.util.Date;

/**
 * 抽取Entity的公用部分，方便操作
 */
public class BaseEntity implements Serializable {
    
    @TableField(fill = FieldFill.INSERT)
    private String createBy;

    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(fill = FieldFill.UPDATE)
    private String updateBy;

    @TableField(fill = FieldFill.UPDATE)
    private Date updateTime;

    /**
     * 逻辑删除字段，需要用@TableLogic标识，配合yml中的配置才能找到
     */
    @TableLogic
    @TableField(fill = FieldFill.INSERT)
    private Integer deleteFlag;

    /**
     * 便于使用mybatis提供的乐观锁
     */
    @TableField(fill = FieldFill.INSERT)
    private Integer version;
}
